import request from '@/utils/request'

// 分页查询订单
export function fetchTicketPage(params) {
  return request({
    url: '/admin/ticket/page',
    method: 'get',
    params,
  })
}

// 订单详情
export function getTicketById(id) {
  return request({
    url: `/admin/ticket/${id}`,
    method: 'get',
  })
}

// 新增订单
export function createTicket(data) {
  return request({
    url: '/admin/ticket/create',
    method: 'post',
    data,
  })
}

// 更新订单
export function updateTicket(data) {
  return request({
    url: '/admin/ticket/update',
    method: 'put',
    data,
  })
}

// 删除订单
export function deleteTicket(id) {
  return request({
    url: `/admin/ticket/${id}`,
    method: 'delete',
  })
}

// 批量删除订单
export function deleteTicketBatch(ids) {
  return request({
    url: '/admin/ticket/batch',
    method: 'delete',
    data: ids,
  })
}